import fetch from 'common/src/utils/fetch'

const api = {
    // 查询列表
    getList(data) {
        return fetch({
            url: '/api/designservice/optApproval/publishList',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 发布课题
    release(data) {
        return fetch({
            url: '/api/designservice/optApproval/publish',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查导师学生课题详情
    getSubjectInfo(data) {
        return fetch({
            url: '/api/designservice/optApproval/detail',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查学院
    getCollege() {
        let authId = localStorage.getItem('activeAuthId')
        return fetch({
            url: `/api/designservice/common/college?authId=${authId}`,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        })
    },
    // 根据毕业年份和学院查专业
    getSubject(data) {
        return fetch({
            url: '/api/designservice/common/findSubject',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 导出
    export(data) {
        return fetch({
            url: '/api/designservice/optApproval/publishExport',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    getExportStatus(key) {
        return fetch({
            url: `/api/designservice/common/exportExcelResult/${key}`,
            method: 'get',
            showMask: false
        })
    },
    // 查审核进度
    getProgress(applyNo) {
        return fetch({
            url: `/api/workflow/approval/selectApproFlow?no=${applyNo}`,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        })
    }
}

export default api
